﻿Imports DotNetNuke.Entities.Content

Public Class Contact
    Inherits ContentItem
    Implements DotNetNuke.Entities.Modules.IHydratable

#Region "---Property---"
    Public Property CellPhoneNumber As String
    Public Property Email As String
    Public Property ID As Integer
    Public Property Name As String
    Public Property PhoneNumber As String
    Public Property Title As String

    Public ReadOnly Property EmailMailTo As String
        Get
            If String.IsNullOrEmpty(Email) = False Then
                Return "mailto:" & Email
            End If

            Return ""
        End Get
    End Property

    Public Overrides Property KeyID As Integer
        Get
            Return Me.ID
        End Get
        Set(value As Integer)
            Me.ID = value
        End Set
    End Property
#End Region

#Region "---Fill---"
    Public Overrides Sub Fill(dr As System.Data.IDataReader)
        'MyBase.Fill(dr)
        Me.CellPhoneNumber = Null.SetNullString(dr("CellPhone"))
        Me.Email = Null.SetNullString(dr("Email"))
        Me.ID = Null.SetNullInteger(dr("ID"))
        Me.ModuleID = Null.SetNullInteger(dr("ModuleID"))
        Me.Name = Null.SetNullString(dr("Name"))
        Me.PhoneNumber = Null.SetNullString(dr("PhoneNumber"))
        Me.Title = Null.SetNullString(dr("Title"))
        Me.ContentItemId = Null.SetNullInteger(dr("ContentItemID"))
    End Sub
#End Region
End Class